<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/jsp/commons/taglibs.jsp"%>
<!DOCTYPE html >
<html>
<head>
</head>
<body>

	<table width="100%" border="0" cellspacing="0" cellpadding="0"
		class="tab">
		<tr>
			<th>序号</th>
			<th>日期</th>
			<th>项目名称</th>
			<th>客户名称</th>
			<th>甲方负责人</th>
			<th>联系电话</th>
			<th>主负责人</th>
			<th>次负责人</th>
			<th>临时负责人</th>
			<th>施工进度</th>
			<th>报价单</th>
			<th>验收</th>
			<th>开票</th>
			<th>收款</th>
			<th>操作</th>
		</tr>
		<c:if test="${empty resultDto.result  }">
		<tr>
			<td colspan="10">没有记录</td>
		</tr>
		</c:if>
		
		<c:forEach items="${resultDto.result}" var="result" varStatus="sn">
			<tr>
				<td>${sn.index+1 }</td>
				<td><fmt:formatDate value="${result.createDate}"
						pattern="yyyy年MM月dd日" /></td>
				<td title="${result.businessName}">${result.businessName}</td>
				<td title="${result.customerName}">${result.customerName}</td>
				<td title="${result.contactName}">${result.contactName}</td>
				<td title="${result.mobileNum}">${result.mobileNum}</td>
				<td title="${result.firstHeadName}">${result.firstHeadName}</td>
				<td title="${result.secondHeadName}">${result.secondHeadName}</td>
				<td title="${result.threeHeadName}">${result.threeHeadName}</td>
				<td title="${result.constructionProgress}">
				<c:choose>
				<c:when test="${fn:length(result.constructionProgress)>20}">${fn:substring(result.constructionProgress, 0, 20)}</c:when>
				<c:otherwise>${result.constructionProgress}</c:otherwise>
				</c:choose>
				</td>
				<td title="${result.quotation}">${result.quotation}</td>
				<td >
				<c:choose>
				<c:when test="${result.isCheck eq '0'}">未验收</c:when>
				<c:when test="${result.isCheck eq '1'}">已验收</c:when>
				</c:choose>
				</td>
				<td >
				<c:choose>
				<c:when test="${result.isInvoice eq '0'}">未开票</c:when>
				<c:when test="${result.isInvoice eq '1'}">已开票</c:when>
				</c:choose>
				</td>
				<td >
				<c:choose>
				<c:when test="${result.isCollect eq '0'}">未收款</c:when>
				<c:when test="${result.isCollect eq '1'}">已收款</c:when>
				</c:choose>
				</td>
				<td title="">
				<c:choose>
					<c:when test="${actionType eq '6'}">
					<a href="#" onclick="processNotice('${result.businessInfoId}')">处理 </a> &nbsp;&nbsp;
					</c:when>
					<c:otherwise>
					<a href="${ctx }/business/businessInfoAction!updateInit.action?businessInfo.businessInfoId=${result.businessInfoId}">编辑 </a> &nbsp;&nbsp;
					<a href="#" onclick="removeBusinessInfo('${result.businessInfoId}')">验收 </a> &nbsp;&nbsp;
					<a href="#" onclick="removeBusinessInfo('${result.businessInfoId}')">开票 </a> &nbsp;&nbsp;
					<a href="#" onclick="removeBusinessInfo('${result.businessInfoId}')">收款 </a> &nbsp;&nbsp;
					<a href="#" onclick="removeBusinessInfo('${result.businessInfoId}')">删除 </a> &nbsp;&nbsp;
					</c:otherwise>
				</c:choose> 
				</td>
			</tr>
		</c:forEach>
	</table>
	<s:if test="resultDto.result!=null && resultDto.result.size()>0">
	<!--分页 begin-->
	<div class="pageleft">共有${resultDto.pagination.total}条数据，当前第${resultDto.pagination.index+1}页</div>
	<%-- 	<div class="pageleft">
		共有${resultDto.pagination.total }条数据，当前第<span id="pageCodeId"></span>页
	</div> --%>
		<c:choose>
			<c:when test="${actionType eq '6'}">
				<div class="pagenum">
					<a href="#" id="topPage"
						onclick="queryPageByCon('${ctx}/business/businessInfoAction!toCenterList.action',0,'noticeResult');">首页</a>
					<span id="Paginationa"></span> <a href="#" id="endPage"
						onclick="queryPageByCon('${ctx}/business/businessInfoAction!toCenterList.action','${totalPage-1 }','noticeResult');">尾页</a>
				</div>
			</c:when>
			<c:otherwise>
				<div class="pagenum">
					<a href="#" id="topPage"
						onclick="queryPage('${ctx}/business/businessInfoAction!listInit.action',0);">首页</a>
					<span id="Paginationa"></span> <a href="#" id="endPage"
						onclick="queryPage('${ctx}/business/businessInfoAction!listInit.action','${totalPage-1 }');">尾页</a>
				</div>
			</c:otherwise>
		</c:choose>

		<input type="hidden" id="totalRow"
			value="${resultDto.pagination.total }" />
		<input type="hidden" id="totalPage" value="${totalPage }" />
		<div class="clear"></div>
	</s:if>
</body>
<script type="text/javascript">
function removeBusinessInfo(workSystemId){
	art.dialog.confirm('你确认删除操作 ', function(){
		$.post("${ctx}/business/businessInfoAction!delete.action", {
			random : Math.random(),
			"businessInfo.businessInfoId" : workSystemId
		}, function(data) {
			var jsonData = strToJson(data);
			if (jsonData.flag == "success") {
				art.dialog.tips('操作成功！', 1.5);
				window.location.href = "${ctx}/business/businessInfoAction!listInit.action";
			} else {
				art.dialog.tips('操作失败，请联系管理员！', 1.5); 
			}
		});
	}, function(){
	     
	});
}
</script>
</html>
